<?php
namespace API\Controller;
use Think\Controller;
class CommonController extends Controller {
	public function response($action,$status,$count,$data){
    	             $result = array(
    	                       'action' => $action,  //表示操作的内容
                                    'status' => $status,  //false表示失败 ，true表示成功
                                    'count' => $count,   //状态标识码  根据操作的内容而变化
                                    'data' => $data       //具体信息
                          );
                          $this->ajaxReturn($result);
                          exit();
	}

	/*
	*判断是否为登录
	*@return false 或
	*/
	public function isLogin(){
		if (!isset($_SESSION['UID']) || $_SESSION['UID']=='' ||
		!isset($_SESSION['head_img']) || $_SESSION['head_img']=='' ||
		!isset($_SESSION['weixin_name']) || $_SESSION['weixin_name']=='' ) {
			return false;
		}else{
			return $_SESSION['UID'];
		}
	}
}